<?php

namespace App\Http\Requests\Admin\Panx\Product;

use App\Http\Requests\ApiRequest;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

/**
 * @property int id
 * @property string type
 */
class ProductCreateInfoRequest extends ApiRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'type' => ['required', 'string', Rule::in(['category', 'product_model'])],
            'id'   => 'required|int'
        ];
    }

//    public function messages()
//    {
//        return [
//            'type.*' => '类型必须是category或者product_model',
//            'id.*'   => 'id必须是数值'
//        ];
//    }
}
